import request from '../utils/request';

export const getVisitorList = async (data: Record<string, any>) => {
  const res = await request<any[]>({
    url: '/visitor/get',
    method: 'GET',
    data
  });
  return res.data || [];
};

export const deleteVisitor = async (data: { id: number }) => {
  const res = await request<undefined>({
    url: '/visitor/delete',
    method: 'GET',
    data
  });
  return res;
};

export const addVisitor = async (data: any) => {
  const res = await request<undefined>({
    url: '/visitor/add',
    method: 'POST',
    data
  });
  return res;
};

export const editVisitor = async (data: any) => {
  const res = await request<undefined>({
    url: '/visitor/update',
    method: 'POST',
    data
  });
  return res;
};